<?php

namespace Siese\EntityBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CatSedesType extends AbstractType
{  protected $empty_value = "Seleccione una Opción";
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('codSede','entity',array('label' => 'Sede',
                                                   'class' => 'SieseEntityBundle:CatSedes',
                                                   'property' => 'codSede',
                                                   'required' => true,
                                                   'expanded' => false,
                                                   'multiple' => false,
                                                   'empty_value' => $this->empty_value,
                                                   'attr' => array(
                                                   'style' => 'margin-bottom:10px;',
                                                   'class' => 'form-control'))) 
           ->add('nbSede')       
                
           
            //->add('codEstado')
            ->add('estatus','choice',array('label' => 'Estatus',
                                                   'choices' => array('A' => 'Activa', 'I' => 'Inactiva'),
                                                   'required' => true,
                                                   'expanded' => false,
                                                   'multiple' => false,
                                                   'mapped'   => true,
                                                   'empty_value' => $this->empty_value,
                                                   'attr' => array(
                                                   'style' => 'margin-bottom:10px;',
                                                   'class' => 'form-control')))  
            ->add('puedeRegistrarInspecciones','choice',array('label' => 'Cargar Inspecciones',
                                                   'choices' => array('1' => 'Si', '0' => 'No'),
                                                   'required' => true,
                                                   'expanded' => false,
                                                   'multiple' => false,
                                                   'mapped'   => true,
                                                   'empty_value' => $this->empty_value,
                                                   'attr' => array(
                                                   'style' => 'margin-bottom:10px;',
                                                   'class' => 'form-control')))  
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Siese\EntityBundle\Entity\CatSedes'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'siese_entitybundle_catsedes';
    }
}
